cmake_minimum_required(VERSION 3.1)

project(main)

include_directories(.)

include_directories(./freetype-2.13.3/include)
link_directories(./freetype-2.13.3/build)

add_subdirectory(lvgl)
add_subdirectory(lv_drivers)

set(TOOLCHAIN_DIR "/usr/local/arm/5.4.0/usr/")
set(CMAKE_C_COMPILER "${TOOLCHAIN_DIR}/bin/arm-linux-gcc")
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_DIR}/bin/arm-linux-g++")

set(CMAKE_C_FLAGS "-Wl,-rpath=.")

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build)

file(GLOB_RECURSE INCLUDES "lv_drivers/*.h" "lvgl/demos/*.h"  "lvgl/*.h"   "./*.h" "obj/*.h")
file(GLOB_RECURSE SOURCES  "lv_drivers/*.c" "lvgl/demos/*.c"  "lvgl/src/*.c"  "obj/*.c" )

add_executable(${PROJECT_NAME} main.c mouse_cursor_icon.c simfang.c   ${SOURCES} ${INCLUDES})
target_link_libraries(${PROJECT_NAME} PRIVATE lvgl lvgl::examples lvgl::demos lvgl::drivers)
target_link_libraries(${PROJECT_NAME} PRIVATE freetype)


include_directories(./UI)
add_subdirectory(./UI)
target_link_libraries(${PROJECT_NAME} PRIVATE ui)
target_link_libraries(${PROJECT_NAME} PRIVATE pthread)